package servicio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

import dominio.Cliente;

public class Conexion extends Thread {
	private Socket socket;
	private ObjectOutputStream salida;
	
	public Conexion(Socket socket){
		this.socket = socket;
	}

	public void run() {
		try {		
			List<Cliente> lista = new ArrayList<Cliente>();
			lista = new Cliente().leerRegistros();		
			salida = new ObjectOutputStream(this.socket.getOutputStream());		
			salida.writeObject(lista);					
			this.socket.close();
		
		} catch (IOException e) {
			e.printStackTrace();
		}	
	}
}
